<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div {
            background-color: red;
            height: 200px;
            width: 400px;
            margin: 50px;
        }
        #div1:hover {
            background-color: #0000ff;
            
            -webkit-transition-property: background-color;
            -webkit-transition-duration: 5s;
            -webkit-transition-timing-function: linear;
        }
        #div2 {
            -webkit-animation-name: x-spin;
            -webkit-animation-duration: 20s;
            /* 无限次循环 */
            -webkit-animation-iteration-count: infinite;
            -webkit-animation-timing-function: linear;
        }
        @-webkit-keyframes x-spin {
            0% {
                -webkit-transform: rotateX(0deg);
            }
            50% {
                -webkit-transform: rotateX(180deg);
                background-color: #0000ff;
            }
            100% {
                -webkit-transform: rotateX(360deg);
                background-color: #ff0000;
            }

        }
        #div2:hover {

        }
    </style>
</head>
<body>
    <!-- 渐变 -->
    <div id="div1"></div>
    <!-- 动画 -->
    <div id="div2">动画</div>
</body>
</html>